var vm = new Vue({
    el: '#app',
    data: {
        host: host,
        question_details: '',
        label_categories: '',
        comment_detail: '',

    },
    mounted: function () {
        axios.get(this.host + '/label_categories/', {
            responseType: 'json'
        })
            .then(response => {
                this.label_categories = response.data
            })
            .catch(error => {
                console.log(error.response.data);
            });
        axios.get(this.host + '/question_details/' + get_query_string('id'), {
            responseType: 'json'
        })
            .then(response => {
                this.question_details = response.data
            })
            .catch(error => {
                console.log(error.response.data);
            });
        axios.get(this.host + '/question_comments/' + get_query_string('id'), {
            responseType: 'json'
        })
            .then(response => {
                this.comment_detail = response.data
            })
            .catch(error => {
                console.log(error.response.data);
            });


    },
    methods: {
        aa: function (label_id, category_id) {
            if (label_id == 1) {
                if (category_id == 1) {
                    {
                        axios.get(this.host + '/label_questions/index/?category=newest', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })

                    }
                }
                if (category_id == 2) {
                    {
                        axios.get(this.host + '/label_questions/index/?category=hot', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
                if (category_id == 3) {
                    {
                        axios.get(this.host + '/label_questions/index/?category=waited', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
            }
            if (label_id == 2) {
                if (category_id == 1) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[0].title + '/?category=newest', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })

                    }
                }
                if (category_id == 2) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[0].title + '/?category=hot', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
                if (category_id == 3) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[0].title + '/?category=waited', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
            }
            if (label_id == 3) {
                if (category_id == 1) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[1].title + '/?category=newest', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })

                    }
                }
                if (category_id == 2) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[1].title + '/?category=hot', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
                if (category_id == 3) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[1].title + '/?category=waited', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
            }
            if (label_id == 4) {
                if (category_id == 1) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[2].title + '/?category=newest', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })

                    }
                }
                if (category_id == 2) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[2].title + '/?category=hot', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
                if (category_id == 3) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[2].title + '/?category=waited', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
            }
            if (label_id == 5) {
                if (category_id == 1) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[3].title + '/?category=newest', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })

                    }
                }
                if (category_id == 2) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[3].title + '/?category=hot', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
                if (category_id == 3) {
                    {
                        axios.get(this.host + '/label_questions/' + this.label_categories[3].title + '/?category=waited', {
                            responseType: 'json'
                        }).then(response => {
                            this.questions = response.data
                        })
                    }
                }
            }
        },


    },


})